package service

import (
	"fmt"
	"ops.alert.center.service/internal/util"
	"time"
)

func SendWechat(SystemAlias string) {
	//发送企业微信测试
	var Time string
	Time = time.Unix(1644837126000/1000, 0).Format("2006-01-02 15:04:05")
	//wechat_template, _ := util.Pingjietemplate("快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", Time, 0, 0)
	email_template, _ := util.Pingjietemplate("快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", "快下班啦！", Time, 1, 0)
	//userids := make([]string, 0)
	//userids = append(userids, "2021061105789")
	//err2 := util.SendWeixin(wechat_template, userids)
	//if err2 != nil {
	//	fmt.Println("发送微信失败!")
	//	fmt.Println(err2)
	//}
	emails := make([]string, 0)
	emails = append(emails, "pengliang.xu@china.zhaogang.com")
	err3 := util.SendMail("愉快周末告警", email_template, emails)
	if err3 != nil {
		fmt.Println("发送邮件失败!")
		fmt.Println(err3)
	}
}
